// for disabling right click use this as it is
document.addEventListener('contextmenu', event => event.preventDefault());
event.preventDefault()
document.addEventListener('contextmenu', event => event.preventDefault());
// ⇓ Test it (fiddle) ⇓
document.addEventListener('contextmenu', event => event.preventDefault());